Skip to content

fix: unify file and image types #3050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 10, 2025
Merged

fix: unify file and image types #3050

merged 4 commits into from
Apr 10, 2025

Conversation

khushal87
Copy link
Member

The goal of the PR is to unify the File and the Asset type, which was previously vaguely implemented to a common Client supported type, RNFile. This can be imported directly from the LLC and used in the SDK and by integrators as well.
The following are the changes and bug fixes in the PR:

  • Unify the File and Asset type to RNFile.
  • Unifying FileUpload and ImageUpload type to a common FileUpload type. This can be removed in future once we utilize the full capability of the new message composer. We can have everything as a LocalAttachment post upload and send the message.
  • The FileUpload type is now a lot simplified compared to what it was before.
  • Now, the image compression logic is improved as we do the compression a long time before we upload the file.
  • I have introduced optional parameters on uploadNewFile; this is for the case where, for audio voice recordings, we do send the type, which cannot be really derived from the mime_type. We can remove it once we finally move to the message composer completely imo.
  • The important change is the native handlers are now unified on the types of key they return from all the upload related APIs.

NOTE: The PR is tested on all the upload modes for native CLI/expo android/iOS.

@isekovanic
Copy link
Contributor

@khushal87 khushal87 requested a review from oliverlaz April 7, 2025 15:47
@isekovanic isekovanic merged commit b28252b into V7 Apr 10, 2025
1 of 5 checks passed
@isekovanic isekovanic deleted the fix-file-upload-type branch April 10, 2025 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants